package com.ekalenchuk.module.dao;

import java.io.Serializable;
import java.util.List;

public interface GenericDao<T, ID extends Serializable> {
	T findById(ID id);

	T findById(ID id, boolean lock);

	List<T> findAll();

	List<T> findByExample(T exampleInstance, String... excludeProperty);

	T save(T entity);

	void makeTransient(T entity);

	void flush();

	void clear();

	void setReadOnly(boolean manual);

	@SuppressWarnings("unchecked")
	T getById(ID id, boolean lock);

	@SuppressWarnings("unchecked")
	T getById(ID id);
}
